package com.patttern.behavior.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * @Author: root
 * @Date: 2018/12/3 21:01
 */
public class ObserverA implements Observer {
    private int myState;

    public ObserverA() {
    }

    public ObserverA(int myState) {
        this.myState = myState;
    }

    public int getMyState() {
        return myState;
    }

    public void setMyState(int myState) {
        this.myState = myState;
    }

    @Override
    public void update(Observable o, Object arg) {
        myState = (Integer) arg;
    }
}
